package com.carrot.newsgallery.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.carrot.newsgallery.entity.UserFile;
import com.carrot.newsgallery.mapper.UserFileMapper;
import com.carrot.newsgallery.service.UserFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserFileServiceImpl extends ServiceImpl<UserFileMapper, UserFile> implements UserFileService {

    @Autowired
    private UserFileMapper userFileMapper;

    @Override
    public UserFile getByFileName(String fileName) {
        LambdaQueryWrapper<UserFile> lqw = new LambdaQueryWrapper<>();
        lqw.eq(true,UserFile::getFileName,fileName);
        return userFileMapper.selectOne(lqw);
    }
}
